#!/bin/sh
# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

#=============================================================================
# Run default case with all available PCG preconditioners (solvers): 
#    10: SMG
#    11: PFMG
#    18: Diagonal scaling
#    19: none
#=============================================================================

# PCG run... LOBPCG run for one eigenpair ... LOBPCG run for 4 eigenpairs
mpirun -np 2  ./sstruct -P 1 1 2 -solver 10 -tol 1.e-6 > sstruct.out.10.lobpcg
mpirun -np 2  ./sstruct -P 1 1 2 -lobpcg -solver 10 -tol 1.e-6 -pcgitr 0 -seed 1 -vrand 1 > sstruct.out.10.lobpcg.1
mpirun -np 2  ./sstruct -P 1 1 2 -lobpcg -solver 10 -tol 1.e-6 -pcgitr 0  -seed 1 -vrand 4  > sstruct.out.10.lobpcg.4

# PCG run... LOBPCG run for one eigenpair ... LOBPCG run for 4 eigenpairs
mpirun -np 2  ./sstruct -P 1 1 2 -solver 11 -tol 1.e-6  > sstruct.out.11.lobpcg
mpirun -np 2  ./sstruct -P 1 1 2 -lobpcg -solver 11 -tol 1.e-6  -pcgitr 0 -seed 1 -vrand 1  > sstruct.out.11.lobpcg.1
mpirun -np 2  ./sstruct -P 1 1 2 -lobpcg -solver 11 -tol 1.e-6  -pcgitr 0 -seed 1 -vrand 4  > sstruct.out.11.lobpcg.4

# PCG run... LOBPCG run for one eigenpair ... LOBPCG run for 4 eigenpairs
mpirun -np 2  ./sstruct -P 1 1 2 -solver 18  > sstruct.out.18.lobpcg
mpirun -np 2  ./sstruct -P 1 1 2 -lobpcg -solver 18 -tol 1.e-6  -pcgitr 10 -seed 1 -vrand 1  > sstruct.out.18.lobpcg.1
mpirun -np 2  ./sstruct -P 1 1 2 -lobpcg -solver 18 -tol 1.e-6  -pcgitr 10 -seed 1 -vrand 4  > sstruct.out.18.lobpcg.4

# PCG run... LOBPCG run for one eigenpair ... LOBPCG run for 4 eigenpairs
mpirun -np 2  ./sstruct -P 1 1 2 -solver 19  > sstruct.out.19.lobpcg
mpirun -np 2  ./sstruct -P 1 1 2 -lobpcg -solver 19 -tol 1.e-6  -pcgitr 10 -seed 1 -vrand 1  > sstruct.out.19.lobpcg.1
mpirun -np 2  ./sstruct -P 1 1 2 -lobpcg -solver 19 -tol 1.e-6  -pcgitr 10 -seed 1 -vrand 4  > sstruct.out.19.lobpcg.4
